#include <iostream>
#include <string>
#include "Array.h"
#include "HeapArray.h"

using namespace std;

void TestArray(void)
{
	Array<int, 5> array;

	for (int i = 0; i < array.length(); i++)
	{
		array[i] = i;
	}

	for (int i = 0; i < array.length(); i++)
	{
		cout << array[i] << endl;
	}
}

void TestHeapArray(void)
{
	HeapArray<double>* parray = HeapArray<double>::NewInstance(5);
	if (parray)
	{
		HeapArray<double>& array = parray->self();

		for (int i = 0; i < 5; i++)
		{
			array[i] = i;
		}

		for (int i = 0; i < array.length(); i++)
		{
			cout << array[i] << endl;
		}
	}
	delete parray;
}

int main(int argc, char **argv)
{
	try
	{
		TestArray();
		cout << endl;
		TestHeapArray();
	}
	catch (...)
	{
		cout << "Exception..." << endl;
	}
	

	return 0;
}